package com.ygqh.baby.controller.admin;

import java.util.Date;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.ao.ResultSet;
import com.ygqh.baby.po.YgUserBalanceDetail;
import com.ygqh.baby.service.YgUserBalanceDetailService;

@Controller
@RequestMapping("/admin/uerBalanceDetail")
public class UserBalanceDetailController extends BaseController<Object, Long>{
	@Autowired
	private YgUserBalanceDetailService ygUserBalanceDetailService;
	
	
	/**
	 * 查询
	 * @param queryInfo
	 * @return
	 */
	@RequestMapping("searchBalanceDetailByUser")
	@ResponseBody
	public Map<String, Object> searchBalanceDetailByUser(QueryInfo queryInfo,String remark,String username,Date startDate,Date endDate){
		ResultSet<YgUserBalanceDetail> resultSet = ygUserBalanceDetailService.search(queryInfo, remark ,username,startDate,endDate);
		return resultSet.toDatatables(null,resultSet.getExt()+"");
	}
	

	/**
	 * 查询
	 * @param queryInfo
	 * @return
	 */
	@RequestMapping("searchBalanceDetailByUserId")
	@ResponseBody
	public Map<String, Object> searchBalanceDetailByUserId(QueryInfo queryInfo,Long userId){
		ResultSet<YgUserBalanceDetail> resultSet = ygUserBalanceDetailService.findByUserIdPage(queryInfo, userId);
		return resultSet.toDatatables(null);
	}
	
}
